/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package aic.security;

import aic.misc.DebugPrint;
import java.io.IOException;
import javax.security.auth.callback.Callback;
import javax.security.auth.callback.CallbackHandler;
import javax.security.auth.callback.UnsupportedCallbackException;
import org.apache.ws.security.WSPasswordCallback;

public class ClientPasswordCallbackHandler implements CallbackHandler {

    public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException {

        DebugPrint.println("Entering handle..");

        WSPasswordCallback pc = (WSPasswordCallback) callbacks[0];

        // set the password for our message.
        DebugPrint.println("Setting password..");
        pc.setPassword("password");
    }

}
